package instanceofdemo;

public class Demo2 {
	public static void main(String[] args) {
		// 引用是来打马虎眼的，看new对象是属于什么
		A a1 = new C();
		A a2 = new E();
		B b1 = new C();
		B b2 = new F();
		System.out.println(a1 instanceof A); // T
		System.out.println(a1 instanceof B); // T
		System.out.println(a1 instanceof C); // T
		System.out.println(a1 instanceof D); // F
		System.out.println(a1 instanceof F); // F
		System.out.println(a2 instanceof A); // T
		System.out.println(a2 instanceof B); // F
		System.out.println(a2 instanceof C); // F
		System.out.println(a2 instanceof D); // T
		System.out.println(a2 instanceof F); // F
		System.out.println(b1 instanceof A); // T
		System.out.println(b1 instanceof B); // T
		System.out.println(b1 instanceof C); // T
		System.out.println(b1 instanceof F); // F
		System.out.println(b2 instanceof A); // T
		System.out.println(b2 instanceof B); // T
		System.out.println(b2 instanceof C); // F
		System.out.println(b2 instanceof F); // T
	}
}
